import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import login from '@/components/login'
import Page from '@/components/Page1'
import Page2 from '@/components/Page2'
import Page3 from '@/components/Page3'
import Page404 from '@/components/404'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';

import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios, axios);
Vue.use(Router)
Vue.use(Element)

export default new Router({
  //mode: 'history',
  //base:'/myvue/',
  routes: [
    {
      path: '/',
      name: '主页',
      component: Home,
      children: [
        {path: 'page1', component: Page, name: '列表'},
        {path: 'page2', component: Page2, name: '插入'},
        {path: 'page3', component: Page3, name: '活动'},
      ]
    }, {
      path: '/login',
      name: '登陆页',
      component: login
    },{
      path:'*',
      component:Page404
    }
  ]
})
